<?php // @version $Id: default_form.php 11917 2009-05-29 19:37:05Z ian $
defined('_JEXEC') or die('Restricted access');
?>
<script src="<?php echo $this->baseurl ?>/templates/skovmarken/Scripts/jquery.validate.js" type="text/javascript" ></script>
<script src="<?php echo $this->baseurl ?>/templates/skovmarken/Scripts/jquery.updnWatermark.js" type="text/javascript" ></script>
<style>
.updnWatermark{padding: 4px 0px 0px 3px;}
</style>

<script src="<?php echo $this->baseurl ?>/templates/skovmarken/fancybox/jquery.fancybox-1.3.2.js" type="text/javascript" ></script>
<link href="<?php echo $this->baseurl ?>/templates/skovmarken/fancybox/jquery.fancybox-1.3.2.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
	$(document).ready(function(){
			$("#gmap").fancybox({
				'width'				: '67%',
				'height'			: '74%',
				'autoScale'			: false,
				'transitionIn'		: 'none',
				'transitionOut'		: 'none',
				'type'				: 'iframe'
			});
	});
</script>
<style>
.updnWatermark{
    color:#848484;
}
</style>
  <div class="bg_content">
	<div class="bg_tt2 m12t">
    	<div class="title2">
        	<img src="<?php echo $this->baseurl ?>/templates/skovmarken/img/icon3.png" alt="" class="mid" />
            Kontakt
        </div>
    </div>
    <div class="p5t m20l">
    <form action="<?php echo JRoute::_('index.php'); ?>" class="form-validate" method="post" name="emailForm" id="emailForm">
    	<div><img src="<?php echo $this->baseurl ?>/templates/skovmarken/img/line_top.jpg" alt="" /></div>
        <div class="p30t p30b">
          	<div class="w330 float_left center"><img src="<?php echo $this->baseurl ?>/templates/skovmarken/img/logo_min.png" alt="" /></div>                    
            <div class="bg_kt_right">
              	<p class="black"><b>SKOVMARKEN</b></p>
            	<p class="p5t">Græsmarkvej 10<br />4632 Bjæverskov</p>
                <p class="p10t">Tlf.: 56 87 08 11</p>
                <p class="p5t red"><a href="mailto:kim@skovmarken.dk">kim@skovmarken.dk</a></p>
            </div>
            <div class="clear"></div>
        </div>
        <div><img src="<?php echo $this->baseurl ?>/templates/skovmarken/img/line_bot.jpg" alt="" /></div>
        <div class="bg_form float_left p10t">
            <div class="input_form">
            	<input name="contact" id="contact" type="text" value="" title="Kontaktperson" class="w320" /><br />
                <input name="email" id="email" type="text" value="" title="Email" class="w320" /><br />
                <input name="name" id="name" type="text" value="" title="Firma/navn" class="w320" /><br />
                <input name="subject1" id="subject1" type="text" value="" title="Emne" class="w320" /><br />
                <textarea name="text" id="text" class="w320" title="Din besked"></textarea><br />
                
                <input style="margin: 0; padding:0 ;background: none; border:none; width:76px; height:20px;" type="image" src="<?php echo $this->baseurl ?>/templates/skovmarken/img/bt_send.png"/>
                
                <img onclick="reset_form();" src="<?php echo $this->baseurl ?>/templates/skovmarken/img/bt_nulstil.png" alt="" />
            </div>
        </div>
        <div class="bt_kt float_left">
        	<a href="http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=Gr%C3%A6smarkvej+10+4632+Bj%C3%A6verskov&aq=&sll=37.0625,-95.677068&sspn=43.123021,79.013672&ie=UTF8&hq=&hnear=Gr%C3%A6smarkvej+10,+4632+Bj%C3%A6verskov,+Denmark&z=8&amp;iwloc=A&amp;output=embed" id="gmap"><img src="<?php echo $this->baseurl ?>/templates/skovmarken/img/bt_herfinder.png" alt="" /></a>
        </div>
        <div class="clear_left"></div>
    	<input type="hidden" name="view" value="contact" />
    	<input type="hidden" name="id" value="<?php echo (int)$this->contact->id; ?>" />
    	<input type="hidden" name="task" value="submit" />
    	<?php echo JHTML::_( 'form.token' ); ?>
        </form>
	</div>
</div>
<script language="javascript">
	jQuery(document).ready(function($) {	
		jQuery.updnWatermark.attachAll();		
				
		jQuery("#emailForm").validate({
			errorPlacement: function(error, element) {			
			},
			invalidHandler: function(form, validator) {
			  var errors = validator.numberOfInvalids();
			  if (errors) {
                $('#alert').html(validator['errorList'][0]['message']);
    			$('#backoverlay').show();
    			$('#show_popup').show();
                $('#f_focus').html(validator['errorList'][0]['element'].name);
				validator['errorList'][0]['element'].focus();
			  } else {
			  }
			},

			rules: {
                contact : "required",
                email: {
					required: true,
					email: true
				},
				name: "required"
				
			},
			messages: {
                contact: "<?php echo JText::_( 'Venligst kontaktperson skal udfylde' ); ?>",
                email: "<?php echo JText::_( 'Venligst email skal udfylde' ); ?>",
				name: "<?php echo JText::_( 'Venligst firma/navn skal udfylde' ); ?>"
			}
		});
        
        close_popup=function(){		
    		var fel=$('#f_focus').html();
            $('#backoverlay').hide();
    		$('#show_popup').hide();
    		$('#' + fel ).focus();
      };
      reset_form=function(){
            document.forms[0].reset()
      };
        
	});
</script>
